<script src="Libraries/js/js.js"></script>
<script language="javascript">
   function rangBuoc(){
   		 document.xemnhatki.cbohocki.selectedIndex=0;
   }
</script>
<?php
	include_once('Models/HocPhan.php');
	include_once('Configs/paging.php');
    include_once('Models/HocKiNamHoc.php');
    include_once('Models/HPMoVaoHKNH.php');
    include_once('Models/LopHocPhan.php');
    include_once('Models/ThoiKhoaBieu.php');
?>

<form name="xemnhatki" method="POST">
<table align="center" class="font" width="800" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td class=main_1><img border="0" src="Libraries/images/tbl_left.gif" width="10" height="25" /></td>
    <td align=center class=main_1>Cập nhật nhật kí giảng dạy lớp học phần</td>
    <td class=main_1><p align="right"><img border="0" src="Libraries/images/tbl_right.gif" width="10" height="25" /></p></td>
  </tr>
  <tr bgcolor="#dae9f3">
    <td class="border_1" colspan="3" valign="top"><table width="100%" border="0" align="center"  >
                <tr>
                    <td width="80" >&nbsp;</td>
                    <td >&nbsp;</td>
                    <td width="80" >&nbsp;</td>
                    <td >&nbsp;</td>
                </tr>
                <tr>
                  <td colspan="4" align="center"><table border="0">
                      <tr>
                        <td>Năm học</td>
                        <td><select name="cbonamhoc" onchange="rangBuoc();">
                          <option value=" "></option>
                          <?php
								$hknh = new HocKiNamHoc();
                                $result = $hknh->dsNamHoc();
                                while ($rows=mysql_fetch_array($result)){
                                    echo "<option value='".$rows['namhoc']."'";				
				                    echo ">".$rows['namhoc']."</option>";
                                }
                                if (isset($_POST['cbonamhoc'])){
                                    echo "<script language=\"javascript\">for(var i=0;i<document.xemnhatki.cbonamhoc.length;i++){if(document.xemnhatki.cbonamhoc[i].value=='$namhoc'){document.xemnhatki.cbonamhoc.selectedIndex=i;break;}}</script>";
                                }
                                ?>
                        </select></td>
                        <td>Học kì</td>
                        <td><select name="cbohocki" onchange="showHPXemNhatKi(document.xemnhatki.cbonamhoc.value,this.value);">
                          <option value="0"></option>
                          <option value="1" <?php if ($_POST['cbohocki']==1) echo "selected='selected'"; ?>>1</option>
                          <option value="2" <?php if ($_POST['cbohocki']==2) echo "selected='selected'"; ?>>2</option>
                          <option value="3" <?php if ($_POST['cbohocki']==3) echo "selected='selected'"; ?>>Hè</option>
                        </select></td>
                        <td><table border="0">
                          <tr>
                            <td>Học phần</td>
                            <td><?php  
                            
                                echo "<div id='hocphan'>";
                                    echo "<select name='cbohp' >";
                                        echo "<option value=' '>Chọn học phần</option>";                                 
                                    echo "</select>";
                                echo "</div>";
                            if (isset($_POST['cbohp'])){
                                    echo "<script language=\"javascript\">showHPXemNhatKi(document.xemnhatki.cbonamhoc.value,document.xemnhatki.cbohocki.value);</script>";
                                  
                             }
                        ?></td>
                          </tr>
                        </table></td>
                        <td><table border="0">
                          <tr>
                            <td>Nhóm</td>
                            <td><div id="lophp">
                              <select name="cbolophp">
                                <option value=""></option>
                              </select>
                            </div></td>
							
                          </tr>
                        </table></td>
                      </tr>
                    </table></td>
                </tr>
                <tr>
          	        <td colspan="4" align=right><label></label></td>
                </tr>
                <tr>
       	          <td colspan="4" align="center"><input type="submit" name="btnxem" value="Xem" class="button_1"/>
                    <input name="btncnnhatkict" type="submit" class="button_1" id="btncnnhatkict" value="Nhật kí chi tiết"/>
                    <input name="btnghinxcuabm" type="submit" class="button_1" id="btnghinxcuabm" value="Nhận xét của BM"/>
                    <input name="btnghinxcuadv" type="submit" class="button_1" id="btnghinxcuadv" value="Nhận xét của DV"/>
                    <input name="btnxncuasv" type="submit" class="button_1" id="btnxncuasv" value="Xác nhận của SV"/></td>
                </tr>
        </table>
       
           

    </td>
  </tr>
</table>
<br />
<?php
	
	if (isset($_POST['btnxem'])){
            
            
            require('Views/Hienthinhatki.php');
        }
?>

 

</form>
